#!/bin/bash
cd ~
wget http://projects.unbit.it/downloads/uwsgi-latest.tar.gz
tar zxvf uwsgi-latest.tar.gz
cd uwsgi*
python3 uwsgiconfig.py --build
python3 setup.py install
#create links
ln -sf $(pwd)/uwsgi /usr/bin/uwsgi

#test
echo "def application(env, start_response):">test.py
echo "    start_response('200 OK', [('Content-Type','text/html')])">>test.py
echo '    return [b"Hello World"]'>>test.py
uwsgi --http :5000 --wsgi-file test.py